/*
* https://blog.csdn.net/qfc_128220/article/details/127417851
* */

const rl = require('readline').createInterface({ input: process.stdin })
const inter = rl[Symbol.asyncIterator]()
const readline = async () => (await inter.next()).value

void (async () => {
	const n = parseInt(await readline())
	
	const coordinates = []
	
	for (let i = 0; i < n; i ++) {
		coordinates.push(await readline())
	}
	
	let count = 0
	
	const set = new Set(coordinates)
	
	for (let i = 0; i < coordinates.length; i ++) {
		const [x1, y1] = coordinates[i].split(' ').map(Number)
		for (let j = i + 1; j < coordinates.length; j ++) {
			const [x2, y2] = coordinates[j].split(' ').map(Number)
			
			const x3 = x2 + (y2 - y1)
			const y3 = y2 - (x2 - x1)
			
			const x4 = x1 + (y2 - y1)
			const y4 = y1 - (x2 - x1)
			
			if (set.has(`${x3} ${y3}`) && set.has(`${x4} ${y4}`)) count ++
			
			
			const x5 = x1 - (y2 - y1)
			const y5 = y1 + (x2 - x1)
			
			const x6 = x2 - (y2 - y1)
			const y6 = y2 + (x2 - x1)
			
			if (set.has(`${x5} ${y5}`) && set.has(`${x6} ${y6}`)) count ++
		}
	}
	
	count = count / 4
	
	console.log(count)
	
})()
